package cn.winstone.utils;

import cn.winstone.enums.StatusCodeEnum;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Winstone
 * @date 2020/7/28 - 9:37 下午
 */
public class ConsolePrint {
    public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static void serverStart() {
        System.out.println("[INFO]" + simpleDateFormat.format(new Date()) + " Http Server starting.");
    }

    public static void serverRunSuccess() {
        System.out.println("[INFO]" + simpleDateFormat.format(new Date()) + "Http Server run success!");
    }

    public static void serverErr() {
        System.err.println("[ERROR]" + simpleDateFormat.format(new Date()) + "Error binding the specified port");
    }

    public static void serverErr(StatusCodeEnum statusCodeEnum) {
        System.err.println("[ERROR]" + simpleDateFormat.format(new Date()) + statusCodeEnum.toString());
    }

    public static void request(String method) {
        System.out.println("[INFO]" + simpleDateFormat.format(new Date()) + " Have a Request Method: " + method);
    }


}
